In this tutorial we will show how to connect ESP8266 WiFi module and 5V Arduino. Since ESP8266 is not 5V tolerant we need some kind of voltage level shifter.
ESP8266 module is not 5V tolerant. It works on 3.3V power suplay. Most Arduinos works on 5V. If we want connect both components we need to adapt voltage levels between. If you are using 3.3V Arduino, then read ESP8266 WiFi and 3.3V Arduino connection.
First we need 3.3V power supply for ESP8266. Good choice for regulator is AMS1117 3.3V. Simple circuit is shown below. Be sure to use big enough capacitor.
ESP8266 VCC and CH_PHD are connected to 3.3V power supply.
AMS1117 3.3V power supply.
Next we need shift voltage levels on data lines. To convert 5V output to 3.3V input level we can use simple resistor divider. In this circuit we use 20K and 10K resistors. With this level shifter we can connect Arduino TX to ESP8266 RX and Arduino digital pin and ESP8266 reset pin.
Arduino TX -> ESP8266 RX
Arduino DO pin -> ESP8266 reset
To connect Arduino RX and ESP8266 TX you may try without level shifter. 3.3V should be enough for logical one in 5V Arduino. Just connect Arduino RX and ESP TX pin. If that doesn't work use level shifter.
For level shifter we need active component. In circuit below we use NPN transistor 2N2222 and two resistors. This level shifter is suitable to connect Arduino RX and ESP8266 TX pin.
Arduino Mega 2560 with TFT shield and ESP8266 module. Arduino Mega 2560 is 5V and ESP8266 is 3.3V.
See more tutorials at http://iot-playground.com/build
Buying guide
To support this site and EasyIoT framework development please buy in our store.
Comments
Any Arduino DO pin. If you have more questions please join community forum.
Thank you in advance.
Please join community forum and ask questions there. Maybe some other user has similar problem.
Thanks for very helpful post.
I have powered ESP8266 directly from Arduino Mega 3.3v pin. Also using Adadruit tft touch shield.
Everything seems to work fine for about three web requests. Then Arduino hangs and I need to reset.
I've noticed the Arduino gets hot around the power connector (I'm using 12V psu for Vin).
Does this mean I need to make the regulator with AMS1117 that you have described above?
Thanks.
Ground is common to 3.3V and 5V and connected to GND pin on ESP.
This is described in other articles.
RSS feed for comments to this post